package org.wggds.webservices.io.data;

import org.wggds.webservices.io.WggdsQueryExcpetion;

public enum ErrorId 
{
    UnknownError (0),
    DatabaseNotAvailable(1),
    QueryError(2),
    UnknownId(3),
    NotSupported(4),
    Warning(5);
    public Integer getId()
    {
        return m_id;
    }

    public void setId(Integer a_id)
    {
        m_id = a_id;
    }

    private Integer m_id = null;

    private ErrorId(Integer a_id)
    {
        this.m_id = a_id;
    }

    public static ErrorId forId( Integer a_id) throws WggdsQueryExcpetion
    {
        for ( ErrorId a : ErrorId.values() )
        {
            if ( a_id.equals(a.m_id) )
            {
                return a;
            }
        }
        throw new WggdsQueryExcpetion("Unknown error ID: " + a_id.toString());
    }
}
